package net.dengzixu.java.homework.period30;

public class TestStudent {
    public static void main(String[] args) {
        double totalScore = 0;


        Student stu1 = new Student("200", "A", 18, 90);
        Student stu2 = new Student("201", "B", 18, 80);
        Student stu3 = new Student("202", "C", 18, 70);
        Student stu4 = new Student("203", "D", 18, 60);
        Student stu5 = new Student("204", "E", 18, 80);

        Student[] students = {stu1, stu2, stu3, stu4, stu5};

        // display Student info & Calc average
        for (int i = 0; i < students.length; i++) {
            students[i].printInfo();
            totalScore += students[i].getScore();
        }

        System.out.println("平均分: " + totalScore / students.length);
    }
}
